<?php

/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Sitepage
 * @copyright  Copyright 2010-2011 BigStep Technologies Pvt. Ltd.
 * @license    http://www.socialengineaddons.com/license/
 * @version    $Id: Foursquare.php 2011-05-05 9:40:21Z SocialEngineAddOns $
 * @author     SocialEngineAddOns
 */
class Sitepage_Form_Foursquare extends Engine_Form {
	
	public function init() {
		
		$this->setTitle ( "'Add to my foursquare' Button" )->setDescription ( 'This button will enable visitors on your page to add your place or tip to their foursquare To-Do List.' )->setMethod ( 'POST' )->setAction ( Zend_Controller_Front::getInstance ()->getRouter ()->assemble ( array () ) );
		$view = Zend_Registry::isRegistered ( 'Zend_View' ) ? Zend_Registry::get ( 'Zend_View' ) : null;
		$url = $view->url ( array ('action' => 'foursquare-help' ), 'sitepage_dashboard', true );
		$description = sprintf ( Zend_Registry::get ( 'Zend_Translate' )->_ ( "Enter the embed code for your Add to foursquare Button. To see how to obtain this code, <a href='javascript:void(0);' onclick=window.open('$url','mywindow','width=700,height=500')>click here</a>." ) );
		
		$this->addElement ( 'Textarea', 'foursquare_text', array ('label' => 'Embed Code', 'description' => $description ) );
		
		$this->foursquare_text->getDecorator ( 'Description' )->setOptions ( array ('placement' => 'PREPEND', 'escape' => false ) );
		
		$this->addElement ( 'Button', 'submit', array ('label' => 'Save', 'type' => 'submit', 'ignore' => true, 'decorators' => array ('ViewHelper' ) ) );
		
		$this->addElement ( 'Cancel', 'cancel', array ('label' => 'cancel', 'link' => true, 'prependText' => ' or ', 'onclick' => 'javascript:parent.Smoothbox.close()', 'decorators' => array ('ViewHelper' ) ) );
		
		$this->addDisplayGroup ( array ('submit', 'cancel' ), 'buttons', array ('decorators' => array ('FormElements', 'DivDivDivWrapper' ) ) );
	}

}

?>